package com.king.stacktrace;

import java.util.Map;

/**
 * @author taomk
 * @version 1.0
 * @since 15-4-19 下午10:18
 */
public class StackTraceTest {

	public static void main(String [] args) {
		for (Map.Entry<Thread, StackTraceElement[]> stackTrace : Thread.getAllStackTraces().entrySet()) {
			Thread thread = stackTrace.getKey();
			StackTraceElement [] stackTraceElements = stackTrace.getValue();

			if (thread.equals(Thread.currentThread())) {
				continue;
			}

			System.out.println("线程：" + thread.getName());
			for(StackTraceElement element : stackTraceElements) {
				System.out.println("\t" + element);
			}
		}
	}
}
